package udpInvoker.main;

import java.io.Serializable;

/**
 * Created by IntelliJ IDEA.
 * User: Espen Skjervold, FFI.
 * Date: 26.nov.2008
 * Time: 23:54:35
 */
public class ServiceDescription implements Serializable {


    private String methodName;
    private Class returnType;
    private Class[] parameterTypes;


    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public Class getReturnType() {
        return returnType;
    }

    public void setReturnType(Class returnType) {
        this.returnType = returnType;
    }

    public Class[] getParameterTypes() {
        return parameterTypes;
    }

    public void setParameterTypes(Class[] parameterTypes) {
        this.parameterTypes = parameterTypes;
    }

    public String toString() {
        return methodName +", " + returnType +", " + getParameterTypesString(parameterTypes);
    }

    private String getParameterTypesString(Class[] parameterTypes) {

        StringBuilder stringBuilder = new StringBuilder();

        stringBuilder.append("[");
        for (Class c : parameterTypes) {
            stringBuilder.append(c.getName() + " ");

        }

        stringBuilder.append("]");

        return stringBuilder.toString();
    }
}
